package com.ruoyi.system.controller;

import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.ruoyi.common.annotation.AnonymousAccess;
import com.ruoyi.common.vo.Result;
import com.ruoyi.system.domain.SysNotice;
import com.ruoyi.system.mapper.SysNoticeMapper;
import io.swagger.annotations.Api;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;

@RestController
@RequestMapping("/notice")
@Api(tags="公告")
public class NoticeController {

    @Autowired
    private SysNoticeMapper noticeMapper;

    /**
     * 公告查询
     */
    @GetMapping("/list")
    @AnonymousAccess
    public Result<List<SysNotice>> list() {
        SysNotice query = new SysNotice();
        query.setNoticeType("2");
        query.setStatus("0");
        List<SysNotice> sysNotices = noticeMapper.selectNoticeList(query);
        return Result.OK(sysNotices);
    }

}
